/*
* Copyright (C) 2012-2013, <Aeihu.z, aeihu.z@gmail.com>.
*
* Game Scenario Maker is a free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* Version 2(GPLv2) as published by the Free Software Foundation.
*/

//#include "CCharacterData.h"
//
//CPlayerDataControl    CPlayerDataControl::playerdatacontrol;
//
//CPlayerDataControl::CPlayerDataControl()
//{
//    Money = 0;
//}
//
//bool CPlayerDataControl::SetHPValue(string name, int v)
//{
//    if(CharacterDataList.count(name) < 1)
//        return false;
//
//    CharacterDataList[name]->HP = CharacterDataList[name]->HP + v;
//
//    if (CharacterDataList[name]->HP > CharacterDataList[name]->MAX_HP)
//        CharacterDataList[name]->HP = CharacterDataList[name]->MAX_HP;
//    else if (CharacterDataList[name]->HP < 0)
//        CharacterDataList[name]->HP = 0;
//
//    return true;
//}
//
//bool CPlayerDataControl::SetMPValue(string name, int v)
//{
//    if(CharacterDataList.count(name) < 1)
//        return false;
//
//    CharacterDataList[name]->MP = CharacterDataList[name]->MP + v;
//
//    if (CharacterDataList[name]->MP > CharacterDataList[name]->MAX_MP)
//        CharacterDataList[name]->MP = CharacterDataList[name]->MAX_MP;
//    else if (CharacterDataList[name]->MP < 0)
//        CharacterDataList[name]->MP = 0;
//
//    return true;
//}
//
//void CPlayerDataControl::OnCleanup()
//{
//    map<string, CCharacterData*>::iterator it;
//
//    for ( it=CharacterDataList.begin() ; it != CharacterDataList.end(); it++ )
//    {
//        delete (*it).second;
//    }
//
//    CharacterDataList.clear();
//    EquipList.clear();
//    ItemList.clear();
//}